package com.example.demorabbitmq.listener;

import com.example.demorabbitmq.constant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class DelayListener {

    @RabbitListener(queues = Constants.DELAYED_QUEUE)
    public void listener(String message) {
        System.out.println(new Date() +"listener 1[ " + "delayed_queue" + " ] 收到消息：" + message);
    }

}
